package com.cjq.service;

import com.cjq.bean.Courier;
import com.cjq.bean.User;
import com.cjq.dao.Impl.UserDaoMysql;

import java.util.List;
import java.util.Map;

public class UserService {
    private static UserDaoMysql dao = new UserDaoMysql();


    public static List<Map<String, Integer>> console() {
        return dao.console();
    }

    public static List<User> findAll(boolean limit, int offset, int pageNumber) {
        return dao.findAll(limit, offset, pageNumber);
    }

    public static boolean insert(User user){
        return dao.insert(user);
    }

    public static User findByUserPhone(String userPhone){
        return dao.findByUserPhone(userPhone);
    }

    public static boolean update(User user){
        return dao.update(user);
    }


    public static boolean delete(int id) {
        return dao.delete(id);
    }

    public static boolean updateLoginTime (String phone){
        return dao.updateLoginTime(phone);
    }

    public static boolean insertByPhone(String phone){
        return dao.insertByPhone(phone);
    }
}

